package cn.sinata.wanglin.mine.activity;

import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;

import com.xilada.xldutils.activitys.TitleActivity;

import java.util.ArrayList;

import butterknife.BindView;
import cn.sinata.wanglin.R;
import cn.sinata.wanglin.adapter.MessageCenterPagerAdapter;

public class MessageCenterActivity extends TitleActivity {
    @BindView(R.id.viewpager_messagecenter)
    ViewPager viewpager;//
    @BindView(R.id.tabs_messagecenter)
    TabLayout tabs;//
    private MessageCenterPagerAdapter mPagerAdapter;
    @Override
    protected int setContentId() {
        return R.layout.activity_messagecenter;
    }

    @Override
    protected void initView() {
        super.initView();
        setTitle("消息中心");
        setupViewPager();
    }

    private void setupViewPager() {
            ArrayList<String> mdatas=new ArrayList<>();
            mdatas.add("平台公告");
            mdatas.add("系统公告");
            mPagerAdapter=new MessageCenterPagerAdapter(getSupportFragmentManager(),mdatas);
            viewpager.setAdapter(mPagerAdapter);
            tabs.setupWithViewPager(viewpager);
    }
}
